﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Kiel.Pdf
{
	/// <summary>
	/// Represents a PDF String Object.
	/// </summary>
	class PdfString : IPdfObject
	{
		public StringType Type { get; set; }

		public string Value { get; set; }

		public override string ToString()
		{
			if (this.Type == StringType.Literal)
			{
				return string.Format("({0})", this.Value);
			}
			else
			{
				StringBuilder text = new StringBuilder();
				foreach (byte data in Encoding.UTF8.GetBytes(this.Value))
					text.Append(data.ToString("X"));
				return string.Format("<{0}>");
			}
		}
	}
}
